package face.pay.task.order;

import com.google.common.cache.Cache;
import face.pay.cache.LocalCache;
import face.pay.task.order.service.ICheckOrderPayStatusService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 检测未支付订单定时任务
 */
@Component
@Slf4j
public class CheckOrderPayStatusTask {

    @Autowired
    private ICheckOrderPayStatusService iCheckOrderPayStatusService;
    /**
     * 查询当前时间前10分钟-5分钟的
     * 未支付的订单
     */
    @Scheduled(cron = "0/30 * * * * ?")
    @Async
    void checkStatus(){

        log.info("查询未支付的订单");
        iCheckOrderPayStatusService.checkStatus();
    }
}
